/*
 * @Author: Qimu
 * @Date: 2020-04-22 22:39:04
 * @LastEditors: Qimu
 * @LastEditTime: 2020-05-28 07:10:34
 * @Description: file content
 * @FilePath: \vue-admin-koa2\vue-admin\src\request\api\role.js
 */
/**
 * 权限管理接口列表
 */
import axios from '@/request/http'; // 导入http中axios封装方法
import qs from 'qs'; // 导入qs模块

export default {
  //新增角色表单   
  setRole(params) {
    return axios.post('/role/setRole', {
      params: qs.parse(params)
    });
  },
  //角色列表   
  rolesList(params) {
    return axios.get('/role/listRole', {
      params: qs.parse(params)
    });
  },
  //修改角色状态
  roleState(params) {
    return axios.patch('/role/updateRole', params);
  },
  //提交编辑角色
  putEditRole(params) {
    return axios.put('/role/putRole', params);
  },
  //删除角色
  deleteRole(params) {
    return axios.delete(`/role/deleteRole/${params._id}`);
  },
};
